﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Text;
using VIP.Events;
using Autofac;
using VIP.Infrastructure;
using VIP.Domain.Core.Factories;
using VIP.Domain.BusServices.Impl;
using VIP.Domain.BusServices;
using VIP.Domain.Core.DomainObject;
using VIP.Domain.Subscribers;

namespace VIP.Domain
{
    public static class DomainExtentions
    {
        public static ContainerBuilder AddDomain(this ContainerBuilder builder, IConfiguration config)
        {
            builder.RegisterType<OrderLoader>().As<IAggregateRootLoader<OrderObj>>().InstancePerLifetimeScope();
            //启用事件发送服务
            builder.AddEventServices();
            return builder;
        }
    }
}
